<!DOCTYPE html>
<html style="width:100%; height:100%">

<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="full-screen" content="yes">
    <meta name="browsermode" content="application">
    <meta name="x5-orientation" content="portrait">
    <link rel="stylesheet" href="/Public/libs/layer/need/layer.css">
    <link rel="stylesheet" type="text/css" href="/Public/app/css/main.css" />
    <link rel="stylesheet" href="/Public/app/css/shake.css" />
    <script src="/Public/libs/jquery-1.9.1.min.js"></script>
    <script src="/Public/libs/store.legacy.min.js"></script>
    <script src="/Public/libs/layer/layer.js"></script>

    <title>签到</title>
    <script type="text/javascript">
        window.onload = function () {

            // function playAudio() {
            //     if (window.HTMLAudioElement) {
            //         var oAudio = document.getElementById('audio');
            //         oAudio.play();
            //     }
            // }

            //put your own code here etc.
            $('.shakeimg-qiandao').removeClass('shake');
            setTimeout(function () {
                $('.shakeimg-qiandao').addClass('shake')
            }, 0)
            // playAudio();
			if (window.history && window.history.pushState) {  
                             $(window).on('popstate', function () {  
                                            window.history.pushState('forward', null, '#');  
                                            window.history.forward(1);  
                                          WeixinJSBridge.call('closeWindow');  
                                });  
              }  
  
              window.history.pushState('forward', null, '#'); //在IE中必须得有这两行  
              window.history.forward(1);

        }
    </script>
    <script type="text/javascript" src="/Public/libs/shake.js"></script>
    <script src="/Public/libs/vconsole.min.js"></script>

</head>

<body id="qiandao-body">
    <!-- <div class="audio" style="width:0; height:0px; overflow:hidden; text-indent:-999px;">
        <audio id='audio' src='/Public/app/sound/5018.mp3' autoplay style="width:0; height:0px;"></audio>
    </div> -->
    <div class="content">
        <div class="indexbg">
            <img class="indexBg" src="/Public/app/images/shake/qiandao-bg.png" />
            <img class="shakeimg-qiandao" src="/Public/app/images/shake/weiqiandao.png" />
            <!-- <img class="cp" src="/Public/app/images/shake/cp.png" /> -->
            <img class="index-footer-Bg" src="/Public/app/images/shake/qian.png" />
        </div>

        <div id="power">请打开微信“扫一扫”现场二维码“签到”</div>


    </div>
</body>
<script>
    $('.shakeimg-qiandao').on('click', function () {
        $('.shakeimg-qiandao').removeClass('shake');
        setTimeout(function () {
            $('.shakeimg-qiandao').addClass('shake')
        }, 10)
    })


    var openid = store.get('cj__openid');

    if (openid) {
        $.ajax({
            type: 'POST',
            url: '/index.php/Active/checklogin',
            data: {
                openid: openid,
            },
            success: function (data) {
                if (data['return_code'] == 1) {
                    $('.shakeimg-qiandao').attr('src', '/Public/app/images/shake/yiqiandao.png');
                    $('#power').hide();
                } else {

                    store.remove('cj__openid');

                }
            },
            error: function (err) {
               //删除所有layer层
				layer.closeAll();
				//信息框
				layer.open({
					content: '服务器出了点问题',
					btn: '关闭'
				});
            }
        })
    }
	

</script>




</html>